\setSlideCaption{Setting initial conditions}

Domain file (abbreviated):

\begin{minted}{xml}
<?xml version="1.0" standalone="yes"?>
<VTKFile type="ImageData">
  <ImageData WholeExtent="0 400 0 40 0 0"
      Origin="0 0 0" Spacing="0.05 0.05 0">
    <Piece Extent="0 400 0 40 0 0">
      <CellData>
        <DataArray Name="Velocity"/>
        <DataArray Name="WaterDepth"/>
        <DataArray Name="BottomElevation"/>
      </CellData>
    </Piece>
  </ImageData>
</VTKFile>
\end{minted}

\newpage

Set field to uniform value:

\begin{minted}{xml}
<DataArray Name="Velocity" NumberOfComponents="2"
isUniform="true" isFunction="false">
  1 0
</DataArray>
\end{minted}

\begin{itemize}
	\item Requires \mintinline{xml}|NumberOfComponents| values (here: 2)
	\item Sets variable in each cell to given value(s)\\
	(here: velocity
	in $x$-direction: \mintinline{xml}|1|,
	in $y$-direction: \mintinline{xml}|0|)
\end{itemize}



\newpage

Set field by function:

\begin{minted}{xml}
<DataArray Name="WaterDepth" NumberOfComponents="1"
isUniform="false" isFunction="true">
  <Function Component="0">
    if ( x &gt; 10, 0, 4)
  </Function>
</DataArray>
\end{minted}

\begin{itemize}
	\item %
Available variables:\\
\texttt{x}, 
\texttt{y}, 
\texttt{z}, 
\texttt{t}, 
\texttt{dt}, 
\texttt{x\_dom}, 
\texttt{y\_dom}, 
\texttt{z\_dom}, and 
\texttt{val\_dom}
%\bigskip
%
\item
Standard math and logical functions supported\\
(full list:%
\href{http://warp.povusers.org/FunctionParser/fparser.html#functionsyntax}
{\color{blue}{
%	\underline{here}%
	\underline{http://warp.povusers.org/FunctionParser/}\\
	\underline{fparser.html\#functionsyntax}%
%	}
}}%
)
%\bigskip
%
\item
Reserved XML characters
%(%
%\texttt{<},
%\texttt{>},
%\texttt{\&}, ...%
%)
must be escaped:

\newcommand{\xmlEsc}[2]{%
%	\texttt{#1}%
	\mintinline{bash}|#1|%
	$\;\;\rightarrow\;\;$%
	\mintinline{xml}|&#2;|%
}
\xmlEsc{<}{lt},$\quad$
\xmlEsc{>}{gt},$\quad$
\xmlEsc{&}{amp}, $\;$...

%\begin{tabular}{@{}l@{$\quad\rightarrow\quad$}l}
%\texttt{<}	& \mintinline{xml}|&lt;| \\
%\texttt{>}	& \mintinline{xml}|&gt;| \\
%\texttt{\&}	& \mintinline{xml}|&amp;| \\
%\end{tabular}
%
%
\end{itemize}

\newpage

Set field to value list:

\begin{minted}{xml}
<DataArray Name="WaterDepth" NumberOfComponents="1"
isUniform="false" isFunction="false">
  10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ...
</DataArray>
\end{minted}

Value list:
\begin{itemize}
	\item Requires
	\mintinline{xml}|NumberOfComponents|
	values per cell
	\arrowItem{impractical for manual input}
	\item Output of raster import and VTK export, and
	\item Only format readable by ParaView
\end{itemize}

\newpage

\setSlideCaption{Setting boundary conditions}

Boundary file (abbreviated):
\begin{minted}{xml}
<?xml version="1.0" standalone="yes"?>
<Boundary nGhostLayers="1">
  <Patch Name="patch1">
    <Vertices>0 1 100</Vertices>
    <BoundaryCondition Field="Velocity"
      Type="slip"/>
    <BoundaryCondition Field="WaterDepth"
      Type="slip"/>
    <BoundaryCondition Field="BottomElevation"
      Type="zeroGradient"/>
  </Patch>
  <Patch Name="patch2">
    ...
  </Patch>
</Boundary>
\end{minted}

Boundary conditions (BC) are set per patch and per field.

\newpage

%Available boundary condition (BC) types:
\newcommand{\ttitem}[1]{\item \texttt{#1}}
\begin{itemize}
	\item General boundary conditions (BC):
	\begin{itemize}
	\ttitem {staticValue}
	\ttitem {dynamicValue}
	\ttitem {zeroGradient}
	\end{itemize}
	\item Shallow Water Equations (SWE) BCs:
	\begin{itemize}
	\ttitem {constantWaterDepth}
	\ttitem {freeOutflow}
	\ttitem {orthogonalDischarge}
	\ttitem {orthogonalVelocity}
	\ttitem {slip}
	\ttitem {weir}
	\end{itemize}
\end{itemize}

Different BC types require different parameters.

\newcommand{\bcCaption}[1]{\newpage\setSlideCaption{BC type: \texttt{#1}}}

\bcCaption{staticValue}

Same options as domain fields:
\begin{itemize}
	\item uniform value(s),
	\item function, and
	\item value list
\end{itemize}

Example (creates constant gradient with slope of $0.05$):
\begin{minted}{xml}
<BoundaryCondition Field="BottomElevation"
    Type="staticValue"
    isUniform="false" isFunction="true">
  <Function Component="0">
    z_dom + 0.05 * (x - x_dom)
  </Function>
</BoundaryCondition>
\end{minted}

\texttt{staticValue} BCs are set once, and never updated.


\bcCaption{dynamicValue}

Similar to \texttt{staticValue}, but updated each time step.
%\medskip

\begin{minted}{xml}
<BoundaryCondition
    Field="BottomElevation" Type="dynamicValue"
    isUniform="false" isFunction="true">
  <Function Component="0">
    z_dom + 0.05 * (x - x_dom) * t
  </Function>
</BoundaryCondition>
\end{minted}

With \mintinline{xml}|isFunction="false"|, time/value pairs are expected:

\begin{minted}{xml}
<BoundaryCondition Field="BottomElevation"
    Type="dynamicValue" isUniform="true"
    isFunction="false" NumberOfTimeValues="2">
  <Values Time="0">0</Values>
  <Values Time="100">10</Values>
</BoundaryCondition>
\end{minted}



\bcCaption{zeroGradient}

\begin{itemize}
	\item No parameters required
	\item Boundary value is kept at neighbouring domain value
\end{itemize}

Example:
\begin{minted}{xml}
<BoundaryCondition
    Field="BottomElevation" Type="zeroGradient"/>
\end{minted}


\newpage\setSlideCaption{Shallow Water Equation BCs}

\begin{itemize}
	\item Use same BC type for \texttt{Velocity} and \texttt{WaterDepth}%
	\item Resolve to field-specific BC types internally
%	, e.g.:
%\begin{minted}{xml}
%<BoundaryCondition
%    Field="Velocity" Type="slip"/>
%<BoundaryCondition
%    Field="WaterDepth" Type="slip"/>
%\end{minted}
	\item Parameters can be set in either field:
\begin{minted}{xml}
<BoundaryCondition Field="Velocity"
 Type="orthogonalDischarge" UnitDischarge="2"/>
<BoundaryCondition Field="WaterDepth"
 Type="orthogonalDischarge"/>
\end{minted}
or
\begin{minted}{xml}
<BoundaryCondition Field="Velocity"
 Type="orthogonalDischarge"/>
<BoundaryCondition Field="WaterDepth"
 Type="orthogonalDischarge" UnitDischarge="2"/>
\end{minted}
\end{itemize}

\bcCaption{constantWaterDepth}

\begin{itemize}%[nosep, itemsep=1ex]
	\item Keeps water depth at specified value,\\
	adjusts velocity accordingly
	\item Field \texttt{Velocity}: no attributes required
	\item Field \texttt{WaterDepth}:
	\arrowItem{%
		same as \texttt{staticValue} BC \\
		(uses \texttt{staticValue} BC type internally)
	}
%	\begin{itemize}%[topsep=0.5ex,itemsep=-1ex,parsep=1ex]
%		\item same as \texttt{staticValue} BC \\
%		(uses \texttt{staticValue} BC type internally)
%	\end{itemize}
%	\arrowItem{%
%		same as uniform \texttt{staticValue} BC\\
%		(\texttt{staticValue} is used internally)
%	}
\end{itemize}

Example:
\begin{minted}{xml}
<BoundaryCondition Field="Velocity"
    Type="constantWaterDepth"/>
<BoundaryCondition Field="WaterDepth"
    Type="constantWaterDepth" NumberOfComponents="1"
    isUniform="true" isFunction="false">
  1.35
 </BoundaryCondition>
\end{minted}



\bcCaption{freeOutflow}

\begin{itemize}
	\item Allows unrestricted outflow
	\item Set min. depth to prevent supercritical outflow:
	\begin{itemize}
		\item Attribute \mintinline{xml}|isLimited|
		(%
		\mintinline{xml}|"true"| or 
		\mintinline{xml}|"false"|%
		)
		\item \mintinline{xml}|isLimited="true"|
		$\rightarrow$
		set min. depth as attribute \mintinline{xml}|Limit| [\si{\metre}]
		\item Default is \mintinline{xml}|isLimited="false"|
		\item Warning is displayed if attribute is not found
	\end{itemize}
	\item Bottom slope must be set manually
%	\item Field \texttt{WaterDepth}:
%	\begin{itemize}
%		\item requires attribute \mintinline{xml}|isLimited|
%		(%
%		\mintinline{xml}|"true"| or 
%		\mintinline{xml}|"false"|%
%		)
%		\item if \mintinline{xml}|isLimited="true"|, 
%		requires attribute \mintinline{xml}|limit| [\si{\metre}]
%	\end{itemize}
%	\item Field \texttt{Velocity}: no parameters required
\end{itemize}

Example:
\begin{minted}{xml}
<BoundaryCondition Field="Velocity"
    Type="freeOutflow"/>
<BoundaryCondition Field="WaterDepth"
    Type="freeOutflow" isLimited="true" Limit=1.35"/>
\end{minted}



\bcCaption{orthogonalDischarge}

\begin{itemize}
	\item Sets orthogonal unit discharge across boundary
	\item Requires attribute \mintinline{xml}|UnitDischarge| $[\si{\square\metre\per\second}]$
	\item Positive value $\rightarrow$ inflow
	\item Negative value $\rightarrow$ outflow
\end{itemize}

Example:
\begin{minted}{xml}
<BoundaryCondition Field="Velocity"
    Type="orthogonalDischarge" UnitDischarge="2"/>
<BoundaryCondition Field="WaterDepth"
    Type="orthogonalDischarge"/>
\end{minted}



\bcCaption{orthogonalVelocity}

\begin{itemize}
	\item Sets orthogonal velocity across boundary
	\item Requires attribute \mintinline{xml}|Velocity| $[\si{\metre\per\second}]$
	\item Positive value $\rightarrow$ inflow
	\item Negative value $\rightarrow$ outflow
\end{itemize}

Example:
\begin{minted}{xml}
<BoundaryCondition Field="Velocity"
    Type="orthogonalVelocity" Velocity="1"/>
<BoundaryCondition Field="WaterDepth"
    Type="orthogonalVelocity"/>
\end{minted}



\bcCaption{slip}

\begin{itemize}
	\item No flow across boundary
	\item No friction (= slip),
	\arrowItem{no change to perpendicular velocity}
	\item No parameters required
	\item Field \texttt{WaterDepth}: uses \texttt{zeroGradient} internally
\end{itemize}
%No parameters required.\\

Example:
\begin{minted}{xml}
<BoundaryCondition Field="Velocity"   Type="slip"/>
<BoundaryCondition Field="WaterDepth" Type="slip"/>
\end{minted}



\bcCaption{weir}
\begin{itemize}
	\item Specialised outflow BC for non-hydrostatic conditions
	\item Parameter is weir air face angle as attribute \mintinline{xml}|angle|
	\item Unit can be degrees (default) or radians
	\item Attribute \mintinline{xml}|isRadians|
	(%
	\mintinline{xml}|"true"| or 
	\mintinline{xml}|"false"|%
	) decides unit
%	\item Requires weir air face angle as attribute \mintinline{xml}|angle|
%	\item Unit can be degrees (default) or radians
%	\item Set attribute \mintinline{xml}|isRadians|
%		(%
%		\mintinline{xml}|"true"| or 
%		\mintinline{xml}|"false"|%
%		) to specify unit
	\item Additional information: \\
	Becker, T (2022): "Modelling impacts of underground structures on urban flood simulations"%
%	,\\ Bachelor Thesis, TU Berlin
\end{itemize}

Example (all three fields must be set to \mintinline{xml}|"weir"|):
\begin{minted}{xml}
<BoundaryCondition Field="Velocity" Type="weir"/>
<BoundaryCondition Field="WaterDepth" Type="weir"/>
<BoundaryCondition Field="BottomElevation"
    Type="weir" angle="30" isRadians="false"/>
\end{minted}

\newpage